package com.example.demo.feign;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.example.demo.entity.User;
@FeignClient("microservice-provider-user") //微服务名称
public interface UserFeignClient {
	
	
	@GetMapping("/getUser/{id}")
	public User getUserById(@PathVariable("id") Long id); //PathVariable annotation was empty on param 0. 需要指定path下的名称
	
	
	@PostMapping(value="/getUser-test",consumes = "application/json")
	public User getUser(@RequestBody User user);
}
